package business;

import javax.servlet.http.HttpServletRequest;

import struts.action.Action;
import struts.form.ActionForm;
import annotation.ActionConfig;
import annotation.ActionConfigBean;

@ActionConfig(action=TestAction.class,form=TestForm.class,path="/test",forwards={"succ,/view/Succ.jsp","fail,/view/Fail.jsp"})
public class TestAction implements Action {

    @Override
    public String execute(HttpServletRequest request, ActionForm form,ActionConfigBean config) {
        String url = "fail";
        TestForm testfm = (TestForm)form;
        if(testfm.getName().equals("cjm")){
            url = "succ";
        }
        return config.getUrl(url);
    }

}
